package com.telit.firecommand.controller.pub.admin;//package com.telit.firecommand.controller.pub.admin;
//
//import cn.hutool.crypto.SecureUtil;
//import com.telit.constant.Constant;
//import com.telit.entity.DataReturn;
//import com.telit.enums.ResultCode;
//import com.telit.util.LanguageUtils;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiImplicitParam;
//import io.swagger.annotations.ApiImplicitParams;
//import io.swagger.annotations.ApiOperation;
//import lombok.RequiredArgsConstructor;
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.http.MediaType;
//import org.springframework.web.bind.annotation.PostMapping;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.bind.annotation.RequestParam;
//import org.springframework.web.bind.annotation.RestController;
//
//
///**
// * 后台管理开放API
// *
// * @author yuezhuang
// * @since 2022-12-01
// */
//@Slf4j
//@RequiredArgsConstructor
//@RestController
//@RequestMapping(value = "/pub/admin", produces = MediaType.APPLICATION_JSON_VALUE)
//@Api(tags = "后台管理开放API", value = "后台管理开放API", produces = MediaType.APPLICATION_JSON_VALUE)
//public class AdminPubController {
//
//    /**
//     * 未设计成可配置项
//     */
//    private String USERNAME = "admin";
//
//    private String PASSWORD = "Telit@2022";
//
//    /**
//     * 简单登录接口，pub/** 后台管理接口未做登录后的权限校验
//     *
//     * @param username 用户名
//     * @param password 密码
//     *
//     * @return token
//     */
//    @ApiImplicitParams({
//            @ApiImplicitParam(name = "username", value = "用户名", required = true, paramType = "form", dataType = "String"),
//            @ApiImplicitParam(name = "password", value = "密码", required = true, paramType = "form", dataType = "String"),
//    })
//    @ApiOperation(httpMethod = Constant.REQUEST_METHOD_POST, value = "登录")
//    @PostMapping(path = "/login")
//    public DataReturn<?> save(@RequestParam(value = "username") String username,
//                              @RequestParam(value = "password") String password) {
//        if (!(USERNAME.equals(username) && PASSWORD.equals(password))) {
//            return DataReturn.failure(ResultCode.UNAUTHORIZED,
//                    LanguageUtils.codeMessage(ResultCode.UNAUTHORIZED.getCode()));
//        }
//        return DataReturn.ok(SecureUtil.md5(username + password));
//    }
//
//}
